function reactive(target = {}){
    if(typeof target !== 'object' || target == null){
        //不是对象或者数组，则返回
        return target
    }

    //代理配置
    const proxyConf = {
        get(target,key,receiver){
            const result = Reflect.get(target,key,receiver)
            console.log('get',key)
            return result //返回结果
        },
        set(target,key,val,receiver){
            const result = Reflect.set(target,key,val,receiver)
            console.log('set',key,val)
            console.log('result',result)
            return result //是否设置成功
    
        },
        deleteProperty(target,key){
            const result = Reflect.deleteProperty(target,key)
            console.log('delete property',key)
            console.log('result',result)
            return result  
        }
    }

    //生成代理对象

    const observed = new Proxy(target,proxyConf)
    return observed
}




//测试数据

const data = {
    name:"zhangsan",
    age:20
}